reverse an array without using another array in java